package com.wenhao.baidu.Main;

import com.wenhao.leetcode.structure.ListNode;

import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author Wenhao Tong
 * @create 2021-08-05 20:45
 */
public class Main {

    public ListNode getNode(ListNode node1,ListNode node2) {
        ListNode temp1 = node1;
        ListNode temp2 = node2;
        while (temp1 != temp2) {
            if (temp1.next == null) {
                temp1 = node2;
            } else {
                temp1 = temp1.next;
            }
            if (temp2.next == null) {
                temp2 = node1;
            } else {
                temp2 = temp2.next;
            }
        }
        return temp1;
    }

}
